@*******************************************************************************************************
//  Index.cshtml - Gbtc
//
//  Copyright © 2020, Grid Protection Alliance.  All Rights Reserved.
//
//  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
//  the NOTICE file distributed with this work for additional information regarding copyright ownership.
//  The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
//  not use this file except in compliance with the License. You may obtain a copy of the License at:
//
//      http://opensource.org/licenses/MIT
//
//  Unless agreed to in writing, the subject software distributed under the License is distributed on an
//  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
//  License for the specific language governing permissions and limitations.
//
//  Code Modification History:
//  ----------------------------------------------------------------------------------------------------
//  04/21/2016 - Stephen Wills
//       Generated original version of source code.
//  08/21/2019 - Christoph Lackner
//       Added Jquery dependencies for Relay Characteristic 
//  02/25/2020 - Christoph Lackner
//       Moved OpenSee out of PQ Dashboard
//
//*****************************************************************************************************@
@using GSF.IO;
@using GSF.IO.Checksums;

@{
    Layout = "";

    Version assemblyVersionInfo = typeof(OpenSEE.MvcApplication).Assembly.GetName().Version;
    string applicationVersion = assemblyVersionInfo.Major + "." + assemblyVersionInfo.Minor + "." + assemblyVersionInfo.Build;
}

@helper ReferenceScript(string path)
{
    string fullPath = FilePath.GetAbsolutePath(path.Substring(2));
    byte[] bytes = File.ReadAllBytes(fullPath);
    uint checksum = Crc32.Compute(bytes, 0, bytes.Length);
    <script src="@Url.Content(path)?v=@checksum"></script>
}
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
    <title>OpenSEE</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta charset="utf-8" />
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />

    <link rel="shortcut icon" type="image/ico" href="~/Images/openSEELogo.png" />
    <link href="@Url.Content("~/@GSF/Web/Shared/Content/bootstrap4.css")" rel="stylesheet">
    <link href="@Url.Content("~/@GSF/Web/Shared/Content/font-awesome.css")" rel="stylesheet">

    <style>
        #eventLink {
            color: #007bff;
        }

        #eventLink:hover {
            color: #0056b3;
        }

        body {
            overflow: hidden;
        }

        #DockCharts{
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div id="DockCharts"></div>
    <script>
        var homePath = '@Html.Raw(Url.Content("~/"))';
        var userIsAdmin = @Html.Raw((ViewBag.IsAdmin ? "true" : "false"));
        var samplesPerCycle = @Html.Raw(ViewBag.SamplesPerCycle);
        var eventID = @Html.Raw(ViewBag.EventID);
        var eventStartTime = '@Html.Raw(ViewBag.EventStartTime)';
        var eventEndTime = '@Html.Raw(ViewBag.EventEndTime)';
        var cycles = @Html.Raw(ViewBag.Cycles ?? 0);
        var userID = @Html.Raw(ViewBag.UserId ?? 0);
        var analyticHandle = null;
        var version = '@applicationVersion';
    </script>
    @if (Request.Browser.Browser == "InternetExplorer" || Request.Browser.Browser == "IE")
    {
        @*<script src="https://polyfill.io/v3/polyfill.min.js?features=default%2Ces2015%2Ces2016%2Ces2017%2Ces5%2Ces6%2Ces7"></script>*@
        <script src="@Url.Content("~/Scripts/default.polyfill.min.js")"></script>
    }

    <script src="@Url.Content("~/@GSF/Web/Shared/Scripts/jquery.js")"></script>
    <script src="@Url.Content("~/@GSF/Web/Shared/Scripts/jquery-ui.js")"></script>
   
    <script src="@Url.Content("~/@GSF/Web/Shared/Scripts/popper.js")"></script>
    <script src="@Url.Content("~/@GSF/Web/Shared/Scripts/bootstrap4.js")"></script>

    @*@Scripts.Render("~/Scripts/OpenSEE")*@
    <script src="@Url.Content("~/Scripts/OpenSEE.js")"></script>
</body>
</html>